Fix: sanitize outgoing chat roles for strict OpenAI-compatible providers#417
Fix: sanitize outgoing chat roles for strict OpenAI-compatible providers#417anurag27397 wants to merge 1 commit intojust-every:mainfrom
Conversation
SummarySome OpenAI-compatible providers (for example DeepSeek, Moonshot Kimi/K2 and similar strict wrappers) strictly validate the This patch normalizes outgoing chat message roles before the payload is serialized and sent to upstream providers. Unknown or custom roles are mapped to the What this change does
Rationale
Tests & QA
Backwards compatibility
Implementation detailsThe sanitizer is inserted just before Files changed:
If maintainers prefer a different fallback (e.g., mapping to |
…> system)